<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script>
    var arr = new Array();//创建一个新的数组 
    // var arr = [];
    var arr1 = [1,'老傅0',2,true];
     console.log(arr1);
     console.log(arr1[1]);

     var arr2 = ['星期一','星期二','星期三','星期四','星期五','星期六','星期日'];
     console.log(arr2[6]);
     for(var i=0;i<=6;i++){
         console.log(arr2[i]);
        
     } console.log(arr2.length);

     var arr3 = [2,6,1,7,4];
     var sum = 0;
     var average = 0;
     for(var i = 0;i < arr3.length;i++){
        sum += arr3[i];
     }
     average = sum / arr3.length;
     console.log(sum);
     console.log(average);

    //  求数组中最大值
    var arr4 = [2,6,1,77,52,25,7];
    var max = 0;
    for(var i=0; i <=arr4.length;i++){
        if(max<=arr4[i]){
            max = arr4[i];
        }
    }console.log(max);

</script>
<body>
    
</body>
</html>